<script>
	export default {
		onLaunch: function() {
			uni.setInnerAudioOption({
				obeyMuteSwitch: false
			});
			const token = uni.getStorageSync('userInfo').token; // 假设token存储在localStorage中，键为'token'
			 if (!token) {
			   // token不存在，处理登录或者提示用户重新登录
			   console.log('Token不存在，请重新登录');
			   this.$sun.navRe('/pages/index/index')
			   
			 } else {
			     this.userInfoFn(token)
			   console.log('Token有效，继续操作');
			 }
			 console.log = () => {};
			
		
		},
		onShow: function() {
			
		},
		onHide: function() {
			console.log('App Hide')
		},
		methods:{
			async userInfoFn(token) {
				const result = await this.$http.post({
					url: this.$api.userInfo,
					data: {

					},
					headers: {
						'Authorization': token
					}
			
				})
			
				if (result.code == 0) {
					
			
				}else{
					setTimeout(()=>{
						 this.$sun.navRe('/pages/index/index')
					},500)
				}
			},
		}
	}
</script>


<style>
	/*每个页面公共css */
	@import url('common/css/sun.css');
	@import url('common/css/public.css');
	@import url('common/css/page.css');

	/*每个页面公共css */
	page {
		background: #f6f6f6;
	}

	/*每个页面公共css */
	view {
		font-size: 31rpx;
	}

	text {
		font-size: 24rpx;
	}

	.bjfff {
		background-color: #fff;
	}

	.width25 {
		width: 25%;
	}

	.width20 {
		width: 20%;
	}

	.width80 {
		width: 80%;
	}

	.width100 {
		width: 100% !important;
	}
    .btnCss2 {
      color: #ffffff;
      font-size: 36rpx;
      background:#7b5cf6;
      width: 520rpx;
      height: 112rpx;
    }
	/* 底部白底定位 */
	.fixed-btn {
		z-index: 999;
		position: fixed;
		bottom: 0;
		width: 100%;
		background-color: #fff;
		padding: 20rpx 20rpx 40rpx;
	}

	.fixed-btn-padding {
		padding-bottom: 180rpx;
	}

	.btn-cls {
		color: #fff;
		font-size: 36rpx;
		line-height: 68rpx;
		width: 710rpx;
		height: 100rpx;
		border-radius: 56rpx;
		background: linear-gradient(82.57deg, rgb(254, 231, 184) 1.895%, rgb(244, 211, 150) 93.739%);
	}

	

	
	.min-radio {
		transform: scale(0.8);
	}

	/* 左侧矩形 */
	.left-rectangle {
		width: 8rpx;
		height: 28rpx;
		background-color: #19c866;
	}

	.m-top40 {
		margin-top: 40rpx;
	}

	.right-border {
		width: 2rpx;
		height: 94rpx;
		background-color: #eeeeee;
	}

	.font32 {
		font-size: 32rpx;
	}

	.font36 {
		font-size: 36rpx;
	}

	.font24 {
		font-size: 24rpx;
	}

	.font26 {
		font-size: 26rpx;
	}

	.font40 {
		font-size: 40rpx;
	}

	.bold {
		font-weight: bold;
	}

	.red {
		color: #ff0000 !important;
	}

	.color6a {
		color: #6A6A6A;
	}

	.colora7 {
		color: #a7a7a7;
	}

	.color333 {
		color: #333;
	}

	.color666 {
		color: #666;
	}

	.color888 {
		color: #888;
	}

	.color999 {
		color: #999;
	}

	.colora5 {
		color: #A5A5A5;
	}

	.golden {
		color: #FFEEBA;
	}

	.green {
		color: #19c866 !important;
	}

	.border50 {
		border-radius: 50%;
	}

	.padding20 {
		padding: 20rpx;
	}

	.padding30 {
		padding: 30rpx;
	}

	.p-left30 {
		padding-left: 30rpx !important;
	}

	.p-left20 {
		padding-left: 20rpx !important;
	}

	.p-align-top20 {
		padding: 20rpx 0;
	}

	.p-align-top30 {
		padding: 30rpx 0;
	}

	.p-align-top40 {
		padding: 40rpx 0 !important;
	}

	.p-right40 {
		padding-right: 40rpx !important;
	}

	.p-around30 {
		padding: 0 30rpx;
	}

	.p-around20 {
		padding: 0 10rpx;
	}

	.p-around10 {
		padding: 0 10rpx;
	}

	.p-align30 {
		padding: 30rpx 0;
	}

	.p-around15 {
		padding: 0 15rpx;
	}

	.margin20 {
		margin: 20rpx;
	}

	.m-top10 {
		margin-top: 10rpx;
	}

	.border-left {
		border-left: 2rpx solid #fff;
	}

	.border {
		border-bottom: 2rpx solid #f6f6f6;
	}

	.p-align-top10 {
		padding: 10rpx 0;
	}

	.p-top10 {
		padding-top: 10rpx;
	}

	.p-top20 {
		padding-top: 20rpx;
	}

	.p-top30 {
		padding-top: 30rpx;
	}

	.p-bottom20 {
		padding-bottom: 20rpx;
	}

	.p-bottom30 {
		padding-bottom: 30rpx;
	}

	.p-bottom10 {
		padding-bottom: 10rpx;
	}

	.text-decoration {
		padding: 0 6rpx;
		text-decoration: line-through;
	}

	.m-left20 {
		margin-left: 20rpx;
	}
.flex-wujustify {
		display: flex;
		align-items: center;
	}
	.m-left10 {
		margin-left: 10rpx;
	}

	.m-right10 {
		margin-right: 10rpx;
	}

	.m-top6 {
		margin-top: 6rpx;
	}

	.m-bottom16 {
		margin-bottom: 16rpx;
	}

	.m-bottom30 {
		margin-bottom: 30rpx;
	}

	.m-bottom6 {
		margin-bottom: 6rpx;
	}

	/* 粘性定位 */
	.sticky-top {
		position: sticky;
		top: 0;
		z-index: 999;
	}

	.relative {
		position: relative;
	}

	.color_FFFFFF {
		color: #fff;
	}

	.flex1 {
		flex: 1;
	}

	.display {
		display: flex;
	}

	.flex {
		display: flex;
		justify-content: center;
		align-items: center;
	}

	.flex-column {
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
	}

	// 上下自动间距对其
	.flex-auto-columns {
		display: flex;
		justify-content: space-around;
		flex-direction: column;
	}

	.flex-columns {
		display: flex;
		flex-direction: column;
	}

	.flex-between-columns {
		display: flex;
		justify-content: space-between;
		flex-direction: column;
	}

	.flex-align-center {
		display: flex;
		align-items: center;
	}

	.flex-top-start {
		display: flex;
		align-items: baseline;
	}

	.flex-bottom {
		display: flex;
		align-items: flex-end;
	}

	.flex-end {
		display: flex;
		align-items: center;
		justify-content: flex-end;
	}

	.flex-between {
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.flex-betweens {
		display: flex;
		justify-content: space-between;
	}

	.flex-around {
		display: flex;
		justify-content: space-around;
		align-items: center;
	}

	.flex-wrap {
		display: flex;
		flex-wrap: wrap;
	}

	/* 3行文字省略 */
	.font-overflow3 {
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-line-clamp: 3;
		overflow: hidden;
		-webkit-box-orient: vertical;
	}

	/* 2行文字省略 */
	.font-overflow2 {
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		overflow: hidden;
		-webkit-box-orient: vertical;
	}

	/* 单行文字省略 */
	.font-overflow {
		text-overflow: ellipsis;
		overflow: hidden;
		white-space: nowrap;
	}
</style>